//
//  HSTool.h
//  mobile
//
//  Created by li on 2017/9/8.
//  Copyright © 2017年 li. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface HSTool : NSObject


/**
 删除指定路径文件

 @param filePath 文件路径
 */
+ (void)deleteFileWithFilePath:(NSString *)filePath;


/**
 UIColor生成图片

 @param color 颜色
 @param height 高度
 @return 图片
 */
+ (UIImage *)createImageWithColor:(UIColor *)color andHeight:(CGFloat)height;

+ (UIWindow *)getWindow;


/**
 获取当前控制器

 @return 结果
 */
+ (UIViewController *)getCurrentViewController;

/**
 收键盘

 @return view
 */
+ (UIView *)getInputAccessoryViewForCloseKeyboard;

//设置状态栏颜色
+ (void)setStatusBarBackgroundColor:(UIColor *)color;

/**
 清除网页缓存
 */
+ (void)clearWebCache;

+ (void)fuwenbenLabel:(UILabel *)labell FontNumber:(id)font AndRange:(NSRange)range AndColor:(UIColor *)vaColor;

#pragma mark NSString NSDictionary NSData

///NSDictionary 转 NSString
- (NSString *)getStringWithDictionary:(NSDictionary *)dictionary;

///NSString非空判断
+ (BOOL)stringIsEmpty:(NSString *)string;

///NSString过滤指定字符
+ (NSString *)filterString:(NSString *)string rule:(NSString *)rule;

/// 判断手机号码地址格式
+ (BOOL)isMobileNumber:(NSString *)mobileNum;

///图片base64编码
+ (NSString *)getBase64Image:(UIImage *)originImage;

///NSString Base64
+ (NSString *)getBase64:(NSString *)input;

///解码 Base64
+ (NSString *)getStringFromBase64:(NSString *)input;

///NSString转NSData
+ (NSData *)getDataFromString:(NSString *)input;

///NSData转NSString
+ (NSString *)getStringFromData:(NSData *)input;

///NSDictionary转NSString
+ (NSString *)getStringFromDictionary:(NSDictionary *)input;

///NSString转NSDictionary或nsarray
+ (id)getDictionaryFromString:(NSString *)input;

///NSData转NSDictionary
+ (NSDictionary *)getDictionaryFromData:(NSData *)input;

///NSDictionary转NSData
+ (NSData *)getDataFromDictionary:(NSDictionary *)input;


///获取文字显示所需的高度
+ (CGFloat)textHeightWithWidth:(CGFloat)width font:(UIFont *)font text:(NSString *)text;

//普通字符串转换为十六进制的
+ (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha;

///状态栏高度
+ (CGFloat)statusbarHeight;

//导航栏高度
+ (CGFloat)navBarHeight;

//tabBar高度
+ (CGFloat)tabBarHeight;

//验证邮箱
+(BOOL)isEmail:(NSString *)email;

//时间戳转成字符串
+ (NSString *)getTimeWithTimeInterval:(NSString *)timeInterval isLong:(BOOL)isLong;
@end
